package com.huaixia.cozeapi.controller;

import com.huaixia.cozeapi.domain.CozeMessage;
import com.huaixia.cozeapi.dto.SubmitChatDTO;
import com.huaixia.cozeapi.response.ApiResponse;
import com.huaixia.cozeapi.service.CozeChatService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author biliyu
 * @date 2024/6/25 14:36
 */
@RestController
@RequestMapping("/sumbit")
@RequiredArgsConstructor
public class SubmitController {

    private final CozeChatService cozeChatService;

    @ApiOperation("对话")
    @PostMapping("/chat")
    public ApiResponse chat(@RequestBody SubmitChatDTO submitChatDTO) {
        Object chatResponse = cozeChatService.chat(submitChatDTO);
        return ApiResponse.ok(chatResponse);
    }

}
